//==============================================================================
#ifndef _CENTITY_H_
    #define _CENTITY_H_

#include <vector>
#include "CObjetoAnimado.h"
#include "CArea.h"
#include "CAnimation.h"
#include "CCamera.h"
#include "CFPS.h"
#include "CSurface.h"

//==============================================================================
class CEntity : public CObjetoAnimado{
	/*public:
		static std::vector<CEntity*>    EntityList;

	protected:
		CAnimation      Anim_Control;

		SDL_Surface*    Surf_Entity;
		SDL_Surface*    Surf_Entity2 [4];

	public:
		float	X;
		float	Y;

		int		Width;
		int		Height;*/
		public:

		bool	MoveLeft;
		bool	MoveRight;
		bool    MoveUp;
		bool    MoveDown;

	public:


	//	bool	Dead;
		int		Flags;

	protected:
		float	SpeedX;
		float	SpeedY;

		float	AccelX;
		float	AccelY;

	//	bool	CanJump;

	public:
		float	MaxSpeedX;
		float	MaxSpeedY;

    protected: t_posicion posicionInicial;
/*	protected:
		int		CurrentFrameCol;
		int		CurrentFrameRow;
		int     CurrentFrameIndex;

	protected:
		int		Col_X;
		int		Col_Y;
		int		Col_Width;
		int		Col_Height;
		int     MaxFrames;
*/
	public:
		CEntity();

		virtual ~CEntity();

/*	public:
		virtual bool OnLoad(char* File, int Width, int Height, int MaxFrames);
*/public:
      //  virtual bool OnLoad(char* File, int Width, int Height, int MaxFrames,int index);

		virtual void OnLoop();

		virtual void OnRender(SDL_Surface* Surf_Display);

		virtual void OnCleanup();

		virtual void OnAnimate();

		virtual bool OnCollision(CEntity* Entity);
	public:
		void    OnMove(float MoveX, float MoveY);

	//	bool 	Jump();

		void 	StopMove();

	public:
		bool    Collides(int oX, int oY, int oW, int oH);

    virtual void ObtenerNuevaPosicion();
	/*protected:
		bool 	PosValid(int NewX, int NewY);

		bool 	PosValidTile(CTile* Tile);

		bool 	PosValidEntity(CEntity* Entity, int NewX, int NewY);*/
};

//==============================================================================
class CEntityCol {
    public:
        static std::vector<CEntityCol>	EntityColList;

	public:
		CEntity* EntityA;
		CEntity* EntityB;

	public:
		CEntityCol();
};

//==============================================================================

#endif
